<template>
  <el-pagination
  :current-page="currentPage"
    :layout="layout"
    :page-size="pageSize"
    :page-sizes="pageSizes"
    :total="total"
    :background='background'
    @current-change='handleChangePage'
    @size-change='handleSizeChange'
    class="container-page"
    />
</template>

<script>
export default {
  props: {
    currentPage: {
      type: Number,
      require: true,
      default: 0
    },
    background: {
      type: Boolean,
      default: true
    },
    total: {
      type: Number,
      require: true,
      default: 0
    },
    pageSize: {
      type: Number,
      require: true,
      default: 10
    },
    pageSizes: {
      type: Array,
      require: false,
      default () {
        return [10, 20, 30, 50, 100]
      }
    },
    layout: {
      type: String,
      default: 'total,sizes,prev,pager,next,jumper'
    }
  },
  methods: {
    handleChangePage (page) {
      this.$emit('current-change', page)
    },
    handleSizeChange (val) {
      this.$emit('size-change', val)
    }
  }
}
</script>

<style lang='scss' scoped>
  .container-page{
    text-align: center;
    margin-top: 10px;
  }
  ::v-deep .el-input--mini .el-input__inner  {
    height: 28px !important;
  }
</style>
